-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement domain removal in mod_roster #3291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3291 +/- ##
==========================================
- Coverage 80.25% 80.24% -0.01%
==========================================
Files 398 398
Lines 32559 32574 +15
==========================================
+ Hits 26129 26139 +10
- Misses 6430 6435 +5
Continue to review full report at Codecov.
|
small_tests_24 / small_tests / 210cda0 internal_mnesia_24 / internal_mnesia / 210cda0 amp_big_SUITE:offline:offline_success:notify_deliver_to_offline_user_recipient_privacy_test{error,
{test_case_failed,
{has_stanzas_but_shouldnt,
{client,
<<"alicE_notify_deliver_to_offline_user_recipient_privacy_test_23.63881@localhost/res1">>,
escalus_tcp,<0.4120.0>,
[{event_manager,<0.3811.0>},
{server,<<"localhost">>},
{username,
<<"alicE_notify_deliver_to_offline_user_recipient_privacy_test_23.63881">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.3811.0>},
{server,<<"localhost">>},
{username,
<<"alicE_notify_deliver_to_offline_user_recipient_privacy_test_23.63881">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alicE_notify_deliver_to_offline_user_recipient_privacy_test_23.63881">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,
<<"alicE_notify_deliver_to_offline_user_recipient_privacy_test_23.63881">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"6b3aed7cb93a59a6">>}]},
[{xmlel,<<"stream:error">>,[],
[{xmlel,<<"conflict">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>}],
[]},
{xmlel,<<"text">>,
[{<<"xml:lang">>,<<"en">>},
{<<"xmlns">>,
<<"urn:ietf:params:x... small_tests_22 / small_tests / 210cda0 small_tests_23 / small_tests / 210cda0 ldap_mnesia_24 / ldap_mnesia / 210cda0 dynamic_domains_24 / pgsql_mnesia / 210cda0 ldap_mnesia_22 / ldap_mnesia / 210cda0 dynamic_domains_23 / pgsql_mnesia / 210cda0 pgsql_mnesia_22 / pgsql_mnesia / 210cda0 ldap_mnesia_23 / ldap_mnesia / 210cda0 pgsql_mnesia_24 / pgsql_mnesia / 210cda0 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 210cda0 mssql_mnesia_24 / odbc_mssql_mnesia / 210cda0 mod_ping_SUITE:server_ping_kill:server_ping_pong{error,{{badmatch,[{[<<"localhost">>,mod_ping,ping_response],
{expected_diff,5},
{before_story,5},
{after_story,9}}]},
[{escalus_mongooseim,post_story_check_metrics,1,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_mongooseim.erl"},
{line,74}]},
{escalus_mongooseim,maybe_check_metrics_post_story,1,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_mongooseim.erl"},
{line,51}]},
{escalus_story,story,4,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,75}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} pgsql_mnesia_23 / pgsql_mnesia / 210cda0 jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"error.480@localhost">>},
{<<"to">>,
<<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_5.749599@localhost/res1">>},
{<<"id">>,<<"44e99ada-6b02-4a14-80e7-507422c51bd5">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-terminate">>},
{<<"sid">>,<<"3b7395f9-cc3f-4ce4-b1a4-af4fc8a1cb9a">>}],
[{xmlel,<<"reason">>,[],
[{xmlel,<<"general-error">>,[],[]},
{xmlel,<<"sip-error">>,
[{<<"code">>,<<"480">>}],
[{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
"<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_5.749599@localhost/res1' id='44e99ada-6b02-4a14-80e7-507422c51bd5' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='3b7395f9-cc3f-4ce4-b1a4-af4fc8a1cb9a'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,395}]},
{jingle_SUITE,
'-resp_... jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"error.480@localhost">>},
{<<"to">>,
<<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_15.720990@localhost/res1">>},
{<<"id">>,<<"0c9984da-859a-41e9-91d9-539f8846d256">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-terminate">>},
{<<"sid">>,<<"c4e6d9a0-0942-41ce-a59e-8e3877df8408">>}],
[{xmlel,<<"reason">>,[],
[{xmlel,<<"general-error">>,[],[]},
{xmlel,<<"sip-error">>,
[{<<"code">>,<<"480">>}],
[{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
"<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_15.720990@localhost/res1' id='0c9984da-859a-41e9-91d9-539f8846d256' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='c4e6d9a0-0942-41ce-a59e-8e3877df8408'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,395}]},
{jingle_SUITE,
'-res... mysql_redis_24 / mysql_redis / 210cda0 riak_mnesia_24 / riak_mnesia / 210cda0 jingle_SUITE:all:jingle_session_is_established_when_calling_a_number{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"[email protected]">>},
{<<"to">>,
<<"alice_jingle_session_is_established_when_calling_a_number_44.20067@localhost/res1">>},
{<<"id">>,<<"8a305c1e-a3d0-4198-99e0-19a2ec622cdd">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-info">>},
{<<"sid">>,<<"3d08a806-e9c3-4f33-b9c0-37b7f8934d16">>}],
[{xmlel,<<"ringing">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:apps:rtp:info:1">>}],
[]}]}]},
"<iq from='[email protected]' to='alice_jingle_session_is_established_when_calling_a_number_44.20067@localhost/res1' id='8a305c1e-a3d0-4198-99e0-19a2ec622cdd' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-info' sid='3d08a806-e9c3-4f33-b9c0-37b7f8934d16'><ringing xmlns='urn:xmpp:jingle:apps:rtp:info:1'/></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,395}]},
{jingle_SUITE,
'-jingle_session_is_established_when_calling_a_number/1-fun-0-',1,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,... |
dae20e0
to
b9df246
Compare
small_tests_24 / small_tests / dae20e0 internal_mnesia_24 / internal_mnesia / dae20e0 |
small_tests_24 / small_tests / b9df246 internal_mnesia_24 / internal_mnesia / b9df246 amp_big_SUITE:offline:offline_failure:error_deliver_to_offline_user_test{error,
{{assertion_failed,assert,is_presence,
{xmlel,<<"stream:error">>,[],
[{xmlel,<<"conflict">>,
[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-streams">>}],
[]},
{xmlel,<<"text">>,
[{<<"xml:lang">>,<<"en">>},
{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-streams">>}],
[{xmlcdata,<<"Replaced by new connection">>}]}]},
"<stream:error><conflict xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>Replaced by new connection</text></stream:error>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{escalus_story,'-drop_presences/2-lc$^0/1-0-',1,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,190}]},
{escalus_story,drop_presences,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,190}]},
{escalus_story,'-start_ready_clients/2-fun-0-',3,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,135}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1267}]},
{escalus_story,start_ready_clients,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,128}]},
... small_tests_22 / small_tests / b9df246 small_tests_23 / small_tests / b9df246 dynamic_domains_24 / pgsql_mnesia / b9df246 ldap_mnesia_24 / ldap_mnesia / b9df246 dynamic_domains_23 / pgsql_mnesia / b9df246 ldap_mnesia_22 / ldap_mnesia / b9df246 pgsql_mnesia_24 / pgsql_mnesia / b9df246 ldap_mnesia_23 / ldap_mnesia / b9df246 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / b9df246 mysql_redis_24 / mysql_redis / b9df246 mam_SUITE:rdbms_async_cache_prefs_cases:messages_filtered_when_prefs_default_policy_is_never{error,{test_case_failed,"ASSERT EQUAL\n\tExpected []\n\tValue [ok]\n"}} pgsql_mnesia_22 / pgsql_mnesia / b9df246 pgsql_mnesia_23 / pgsql_mnesia / b9df246 mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"5\n",0}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/app/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1056}]},
{escalus_story,story,4,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1784}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1293}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1225}]}]}} mssql_mnesia_24 / odbc_mssql_mnesia / b9df246 riak_mnesia_24 / riak_mnesia / b9df246 internal_mnesia_24 / internal_mnesia / b9df246 pgsql_mnesia_23 / pgsql_mnesia / b9df246 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me. I don't have any extra comments, I responded to the existing ones.
b9df246
to
379b5f9
Compare
small_tests_24 / small_tests / 379b5f9 internal_mnesia_24 / internal_mnesia / 379b5f9 small_tests_22 / small_tests / 379b5f9 small_tests_23 / small_tests / 379b5f9 dynamic_domains_24 / pgsql_mnesia / 379b5f9 ldap_mnesia_22 / ldap_mnesia / 379b5f9 ldap_mnesia_24 / ldap_mnesia / 379b5f9 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 379b5f9 dynamic_domains_23 / pgsql_mnesia / 379b5f9 pgsql_mnesia_22 / pgsql_mnesia / 379b5f9 ldap_mnesia_23 / ldap_mnesia / 379b5f9 mysql_redis_24 / mysql_redis / 379b5f9 mam_SUITE:rdbms_prefs_cases:prefs_set_cdata_request{error,{test_case_failed,"ASSERT EQUAL\n\tExpected {prefs_result_iq,<<\"roster\">>,\n [<<\"[email protected]\">>,\n <<\"[email protected]\">>],\n []}\n\tValue {prefs_result_iq,<<\"always\">>,\n [<<\"[email protected]\">>,\n <<\"[email protected]\">>],\n []}\n"}} mssql_mnesia_24 / odbc_mssql_mnesia / 379b5f9 pgsql_mnesia_23 / pgsql_mnesia / 379b5f9 riak_mnesia_24 / riak_mnesia / 379b5f9 jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"error.480@localhost">>},
{<<"to">>,
<<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_94.777812@localhost/res1">>},
{<<"id">>,<<"194c1450-08a0-499f-ba2e-ceca4e95d3ec">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-terminate">>},
{<<"sid">>,<<"06dcb2c5-b3b4-44f1-8909-9d9472af0975">>}],
[{xmlel,<<"reason">>,[],
[{xmlel,<<"general-error">>,[],[]},
{xmlel,<<"sip-error">>,
[{<<"code">>,<<"480">>}],
[{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
"<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_94.777812@localhost/res1' id='194c1450-08a0-499f-ba2e-ceca4e95d3ec' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='06dcb2c5-b3b4-44f1-8909-9d9472af0975'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,395}]},
{jingle_SUITE,
'-res... s2s_SUITE:node1_tls_optional_node2_tls_required_trusted_with_cachain:simple_message{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"alice_simple_message_69.199480@fed1/res1">>,
escalus_tcp,<0.12778.1>,
[{event_manager,<0.12774.1>},
{server,<<"fed1">>},
{username,<<"alice_simple_message_69.199480">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12774.1>},
{server,<<"fed1">>},
{username,<<"alice_simple_message_69.199480">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alice_simple_message_69.199480">>},
{server,<<"fed1">>},
{host,<<"localhost">>},
{port,5242},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"alice_simple_message_69.199480">>},
{server,<<"fed1">>},
{host,<<"localhost">>},
{port,5242},
{password,<<"makota2">>},
{stream_id,<<"44bbd3e6359dce24">>}]},
10000],
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{s2s_SUITE,'-simple_message/1-fun-0-',2,
[{file,"/home/circleci/app/big_tests/tests/s2s_SUITE.erl"},
{line,124}]},
{escalus_story,story,4,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_serve... small_tests_23 / small_tests / 379b5f9 pgsql_mnesia_24 / pgsql_mnesia / 379b5f9 |
{selected, []} = select_roster_version(host_type(), domain()) | ||
end). | ||
|
||
select_rosterusers(HostType, Domain) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this function can be simplified like(name can be used other):
select_from_roster(Table) ->
Query = "SELECT * FROM " ++ Table ++ " WHERE server='" ++ binary_to_list(domain()) ++ "'",
{selected, Res} = rpc(mim(), mongoose_rdbms, sql_query, [host_type(), Query]),
Res.
using:
[] = select_from_roster("rosterusers")
[_] = select_from_roster("rostergroups")
[] = select_from_roster("roster_version")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Posted small comment, but since comment is related to tests, this can be done in any time.
This PR implements domain removal in mod_roster (only rdbms).
Proposed changes include: